home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PAS_0493
/
FIXEDM.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-04-29
|
665b
|
26 lines
P386N
Dividend EQU dword ptr [bp+10]
Divisor EQU dword ptr [bp+6]
_TEXT SEGMENT BYTE USE16 PUBLIC 'CODE'
ASSUME cs:_TEXT
PUBLIC FixedDiv
PROC FixedDiv FAR
push bp
mov bp,sp
mov edx,Dividend
sub eax,eax
shrd eax,edx,16 ; position so that result ends up
sar edx,16 ; in EAX
idiv Divisor
shld edx,eax,16 ; whole part of result in DX
; fractional part is already in AX
pop bp
ret
ENDP FixedDiv
_TEXT ENDS
END